﻿//----------------------------------------------------------------------------------------------------
//程序名:	Users实体类
//功能:   定义了与 dbo.Users 表 对应的数据实体类
//作者:  	xiguazerg
//时间:	2009-10-16 
//----------------------------------------------------------------------------------------------------
//更改历史:
//日期		         更改人		     更改内容
//----------------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Text;
using Helper;
using System.Security.Cryptography;

namespace com.SEO.Model
{
    /// <summary>
    /// Users实体类
    /// </summary>
    [Serializable]
    public class UserInfo : BaseInfo
    {
        #region Constructor

        /// <summary>
        /// Constructor
        /// </summary>
        public UserInfo()
        {
            //todo
        }
        #endregion

        #region Field
        private Guid _userId = Guid.Empty;
        private string _userAccount = DBEmptyString;
        private string _userPassword = DBEmptyString;
        private string _userQQ = DBEmptyString;
        private Guid _siteId = Guid.Empty;
        private bool _userType;
        #endregion

        #region Property
        /// <summary>
        /// UserID 
        /// </summary> 
        public Guid UserId
        {
            get { return _userId; }
            set { _userId = value; }
        }

        /// <summary>
        /// UserAccount 
        /// </summary> 
        public string UserAccount
        {
            get { return _userAccount; }
            set { _userAccount = value; }
        }

        /// <summary>
        /// UserPassword 
        /// </summary> 
        public string UserPassword
        {
            get { return _userPassword; }
            set { _userPassword = value; }
        }

        /// <summary>
        /// UserQQ 
        /// </summary> 
        public string UserQQ
        {
            get { return _userQQ; }
            set { _userQQ = value; }
        }

        /// <summary>
        /// SiteID 
        /// </summary> 
        public Guid SiteId
        {
            get { return _siteId; }
            set { _siteId = value; }
        }

        /// <summary>
        /// UserType 
        /// </summary> 
        public bool UserType
        {
            get { return _userType; }
            set { _userType = value; }
        }

        #endregion

        public static string UserMd5(string str)
        {
            string pwd = "";
            MD5 md5 = MD5.Create();
            byte[] s = md5.ComputeHash(Encoding.UTF8.GetBytes(str));
            for (int i = 0; i < s.Length; i++)
            {
                pwd = pwd + s[i].ToString("X");
            }
            return pwd;
        }
    }
}